import http from "@/api";

import { ResPage } from "@/api/interface";
import { OptionVo } from "@/biz/interface";

import { CompanyClientEntity, CompanyClientVo } from "@/biz/interface/CompanyType";

import { ModuleMainUrl } from "..";

const moduleUrl = ModuleMainUrl;

// * 获取招工企业列表
export const getCompanyVoListApi = (params: {}) => {
  return http.post<ResPage<CompanyClientVo>>(moduleUrl + `/cpy/clientvolist`, params);
};

// * 新增招工企业接口
export const saveCompanyApi = (company: CompanyClientEntity) => {
  return http.post(moduleUrl + `/cpy/clientsave`, company);
};

// * 详情招工企业接口
export const getCompanyInfoApi = (params: { id: string }) => {
  return http.post<CompanyClientEntity>(moduleUrl + `/cpy/clientinfo`, params);
};

// * 删除招工企业接口
export const deleteCompanyApi = (params: { id: string }) => {
  return http.post(moduleUrl + `/cpy/clientdelete`, params);
};

// * 修改招工企业状态接口
export const changeFlagActiveApi = (params: { id: string }) => {
  return http.post(moduleUrl + `/cpy/clientactive`, params);
};

// * 获取招工下拉选择
export const getCompanyDropApi = (params: {}) => {
  return http.post<ResPage<OptionVo>>(moduleUrl + `/cpy/clientdropvo`, params);
};
